package com.wy.Service.impl;

import com.wy.Service.RoomService;
import com.wy.dao.RoomDao;
import com.wy.pojo.Room;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("roomServer")
@Transactional
public class RoomServerimpl implements RoomService {
    @Resource
    private RoomDao roomDao;

    @Override
    public List<Room> searchAll() {
        return roomDao.findAll();
    }

    @Override
        public List<Room> searchidAll(Integer danyuanid) {
        return roomDao.searchidAll(danyuanid);
    }

    @Override
    public void del(Integer id) {
        roomDao.deleteById(id);
    }
    @Override
    public void add(Room room) {
        roomDao.save(room);
    }

    @Override
    public void update(Room room) {
        roomDao.save(room);
    }


}
